function appendUrlParams(url, params) {
    // 检查URL是否已经有查询参数
    var hasQuery = url.indexOf('?') !== -1;
    var separator = hasQuery ? '&' : '?';

    // 将参数对象转换成查询字符串
    var queryString = '';
    for (var key in params) {
        if (params.hasOwnProperty(key)) {
            queryString += (queryString ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
        }
    }

    // 将查询字符串拼接到URL上
    return url + separator + queryString;
}
function func_get(url, data) {
    var urlParams = appendUrlParams(url, JSON.parse(data));
    var result = null;
    var request = new XMLHttpRequest();
    /*设置请求方法与路径*/
    request.open("get", urlParams, false);

    request.setRequestHeader("Access-Control-Allow-Origin", "*")
    /*不发送数据到服务器*/
    request.send();
    /*XHR对象获取到返回信息后执行*/
    if (request.status === 200) {
        console.log(request.responseText)
        result = request.responseText;
    } else {
        console.log(request.responseText)
    }

    return result;
}
